from .models import pfmea_table_info, pfmea_table_data
from rest_framework import serializers


class pfmea_table_infoSerializer(serializers.ModelSerializer):
    class Meta:
        model = pfmea_table_info
        fields = ["base", "base_zone", "pfmea_number", "partNumber", "partName", "responsibility", "keyDate", "editDate", "editor", "coreTeam", "version"]


class pfmea_table_dataSerializer(serializers.ModelSerializer):
    class Meta:
        model = pfmea_table_data
        fields = [
            "pfmea_op",
            "ProcessFunction",
            "PotentialFailureMode",
            "PotentialEffectsOfFailure",
            "Severity",
            "Class",
            "PotentialCausesOfFailure",
            "Occurence",
            "CurrentProcessControlsPrevention",
            "CurrentProcessControlsDetection",
            "Detection",
            "Rpn",
            "SeverZone",
            "DetectZone",
            "RiskPriorLevel",
            "RecommendedActions",
            "ResponsibilityAndTargetCompletionDate",
            "ActionTaken",
            "ActionTakenSeverity",
            "ActionTakenOccurence",
            "ActionTakenDetection",
            "ActionTakenRpn",
            "created_at",
            "updated_at",
            "pfmea_info",
        ]
